# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.PrivateCA.V1.Model.CaPool do
  @moduledoc """
  A CaPool represents a group of CertificateAuthorities that form a trust anchor. A CaPool can be used to manage issuance policies for one or more CertificateAuthority resources and to rotate CA certificates in and out of the trust anchor.

  ## Attributes

  *   `issuancePolicy` (*type:* `GoogleApi.PrivateCA.V1.Model.IssuancePolicy.t`, *default:* `nil`) - Optional. The IssuancePolicy to control how Certificates will be issued from this CaPool.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. Labels with user-defined metadata.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Identifier. The resource name for this CaPool in the format `projects/*/locations/*/caPools/*`.
  *   `publishingOptions` (*type:* `GoogleApi.PrivateCA.V1.Model.PublishingOptions.t`, *default:* `nil`) - Optional. The PublishingOptions to follow when issuing Certificates from any CertificateAuthority in this CaPool.
  *   `tier` (*type:* `String.t`, *default:* `nil`) - Required. Immutable. The Tier of this CaPool.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :issuancePolicy => GoogleApi.PrivateCA.V1.Model.IssuancePolicy.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :publishingOptions => GoogleApi.PrivateCA.V1.Model.PublishingOptions.t() | nil,
          :tier => String.t() | nil
        }

  field(:issuancePolicy, as: GoogleApi.PrivateCA.V1.Model.IssuancePolicy)
  field(:labels, type: :map)
  field(:name)
  field(:publishingOptions, as: GoogleApi.PrivateCA.V1.Model.PublishingOptions)
  field(:tier)
end

defimpl Poison.Decoder, for: GoogleApi.PrivateCA.V1.Model.CaPool do
  def decode(value, options) do
    GoogleApi.PrivateCA.V1.Model.CaPool.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.PrivateCA.V1.Model.CaPool do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
